package com.xiaoshuidi.cloud.module.iot.enums;

import java.util.stream.Stream;

/**
 * @author Sky
 * create 2019/04/11
 * email sky.li@ixiaoshuidi.com
 **/
public enum BrandEnum {
    YUNDING("yunding", "云丁"),
    QIANDING("qianding", "千丁"),
    BITE("bite", "比特"),
    ANT_YUNDING("ant_yunding", "蚂蚁-云丁"),
    ANT_FENGDIAN("ant_fengdian", "蚂蚁-蜂电"),
    ANT_DANBEI("ant_danbei", "蚂蚁-蛋贝"),
    ANT_RUANKU("ant_ruanku", "蚂蚁-软库"),
    ANT_HONGANXING("ant_honganxing", "蚂蚁-宏安兴"),
    ANT_YUEYUENIAO("ant_yueyueniao","蚂蚁-月月鸟"),
    ANT_CHAOYI("ant_chaoyi","蚂蚁-超仪"),
    XiMENG("ximeng", "熙盟"),
    ALI_HOMELINK("ali_homelink", "阿里智慧人居"),
    SHANGTANG("shangtang","商汤"),
    ANXUNTONG("anxuntong","安讯通"),
    HAIKANG("haikang","海康"),
    FENGDIAN("fengdian","蜂电"),
    GUOJIA("guojia","果加"),
    TIANGU("tiangu","天固"),
    ZHONGTIAN("zhongtian","中天"),
    CHAOYI("chaoyi","超仪"),
    HAILIAN("hailian","海联"),
    TONGCHUANG("tongchuang","同创"),
    KANGBAOLAI("kangbaolai","康宝莱"),
    WEILIU("weiliu","威流"),
    SHANKE("shanke","山科"),
    MIJIAYUAN("mijiayuan","咪家园"),
    DANBEI("danbei","蛋贝"),
    WOTA("wota","沃塔"),
    WATT("watt","电瓦特"),
    ZHENGTAI("zhengtai","正泰"),
    XIDUN("xidun","西顿"),
    WUMI("wumi","物米"),
    KUNSHAN("kunshan","琨山"),
    ZHIXIN("zhixin","指芯"),
    YINTONGWULIAN("yintongwulian","银通物联");

    private String brand;
    private String brandName;

    BrandEnum(String brand) {
        this.brand = brand;
    }


    BrandEnum(String brand, String brandName) {
        this.brand = brand;
        this.brandName = brandName;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }


    public String getBrandName() {
        return brandName;
    }

    public void setBrandName(String brandName) {
        this.brandName = brandName;
    }

    /**
     * 根据品牌查询品牌枚举
     *
     * @param brand
     * @return
     */
    public static BrandEnum getBrandEnum(String brand) {
        return Stream.of(BrandEnum.values()).filter(brandEnum -> brand.equals(brandEnum.getBrand())).findFirst().get();
    }

}
